#ifndef REMIITEM_H
#define REMIITEM_H

#include <QTreeWidgetItem>
#include <QtSql>
#include <QDateTime>
#include <QDebug>
#include <QMessageBox>
#include "decipheraddon.h"

class RemiItem : public QObject, public QTreeWidgetItem
{
    Q_OBJECT

public:
    explicit RemiItem(int id=-1);
    RemiItem(QString gtin=QString(), QString addon=QString(), int quantity=1);
    void setData(int column, int role, const QVariant &value);
    QVariant data(int column, int role) const;
    int type() const;

    void deleteRemi();

    void setHighlighted(bool highlight);
    void setPaket(int paket);
    void setTitle(QString title);

    void addQuantity(int add);
    void setQuantity(int quan);

    int getID() const;
    int getPaket() const;
    QString getGTIN() const;
    QString getAddon() const;
    int getQuantity() const;
    float getPreis() const;
    QString getTitle() const;

    QDateTime getLastEdit() const;

Q_SIGNALS:
    void deleteItem(RemiItem*);
    void itemChanged();
    void titleChanged();
    
public slots:

private:
    QSqlDatabase db;
    DecipherAddon da;
    int id;
    QString objektnr;
    int paket;
    QString title;
    QString gtin;
    QString addon;
    int quantity;
    QDateTime lastedit;
    float preis;

    bool highlight;
};

#endif // REMIITEM_H
